package com.myproject.common;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import com.myproject.common.utils.PropertiesLoader;

public class Global {
	
	private static Map<String, String> map =new HashMap<String, String>() ;
	  
    private static PropertiesLoader propertiesLoader = new PropertiesLoader(new String[] { "constant.properties" });
	  
    public static String getConfig(String key){
	    String value = (String)map.get(key);
	    if (value == null) {
	      value = propertiesLoader.getProperty(key);
	      map.put(key, value);
	    }
	    return value;
	  }
    
    public static String getAdminPath()
    {
      return getConfig("adminPath");
    }
    
    public static String getFrontPath()
    {
      return getConfig("frontPath");
    }

}
